package com.htgd.gardenexpo.service.impl;

import com.htgd.gardenexpo.entity.GeConImpressionUpload;
import com.htgd.gardenexpo.dao.GeConImpressionUploadDao;
import com.htgd.gardenexpo.service.GeConImpressionUploadService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * (GeConImpressionUpload)表服务实现类
 *
 * @author makejava
 * @since 2021-06-08 15:18:32
 */
@Service("geConImpressionUploadService")
public class GeConImpressionUploadServiceImpl implements GeConImpressionUploadService {
    @Resource
    private GeConImpressionUploadDao geConImpressionUploadDao;

    /**
     * 通过ID查询单条数据
     *
     * @param id 主键
     * @return 实例对象
     */
    @Override
    public GeConImpressionUpload queryById(Integer id) {
        return this.geConImpressionUploadDao.queryById(id);
    }

    /**
     * 查询多条数据
     *
     * @param offset 查询起始位置
     * @param limit  查询条数
     * @return 对象列表
     */
    @Override
    public List<GeConImpressionUpload> queryAllByLimit(int offset, int limit) {
        return this.geConImpressionUploadDao.queryAllByLimit(offset, limit);
    }
    @Override
    public List<GeConImpressionUpload> queryByImpressionId(int id) {
        return this.geConImpressionUploadDao.queryByImpressionId(id);
    }

    /**
     * 新增数据
     *
     * @param geConImpressionUpload 实例对象
     * @return 实例对象
     */
    @Override
    public GeConImpressionUpload insert(GeConImpressionUpload geConImpressionUpload) {
        this.geConImpressionUploadDao.insert(geConImpressionUpload);
        return geConImpressionUpload;
    }

    /**
     * 修改数据
     *
     * @param geConImpressionUpload 实例对象
     * @return 实例对象
     */
    @Override
    public GeConImpressionUpload update(GeConImpressionUpload geConImpressionUpload) {
        this.geConImpressionUploadDao.update(geConImpressionUpload);
        return this.queryById(geConImpressionUpload.getId());
    }

    /**
     * 通过主键删除数据
     *
     * @param id 主键
     * @return 是否成功
     */
    @Override
    public boolean deleteById(Integer id) {
        return this.geConImpressionUploadDao.deleteById(id) > 0;
    }

    @Override
    public boolean deleteByImpressionId(Integer id) {
        return this.geConImpressionUploadDao.deleteByImpressionId(id) > 0;
    }
    @Override
    public boolean deleteByIds(String[] id,int iid) {
        return this.geConImpressionUploadDao.deleteByIds(id,iid) > 0;
    }
}
